#ifndef _PANEL_
#define _PANEL_

#include <vector>
#include "InterfaceElement.hpp"

/** 
* A basic container for elements.
*/
class Panel:public InterfaceElement{
public:
    /** 
    * How the size and position of the panel acts.
    */
    enum FormatType{
        /** 
        * Size remains whatever it is set.
        */
        Static = 0,

        /** 
        * Panel stretches vertically.
        */
        VerticalStretch = 1,

        /** 
        * Panel stretches horizontally.
        */
        HorizontalStretch = 2,

        /** 
        * Panel keeps its distance from the right constant.
        */
        BindRight = 4,

        /** 
        * Panel keeps its distance from the bottom constant.
        */
        BindBottom = 8
    };

protected:
     int formatType;

public:
    std::vector<sf::Drawable*> elements;
    std::vector<InterfaceElement*> interfaceElements;

	Panel();
    Panel(int x, int y, int width, int height, int format);
    virtual void onResize(int width, int height);
    virtual void add(sf::Drawable* element);
    virtual void add(InterfaceElement* element);
    virtual void remove(InterfaceElement* element);
    virtual void clear();
    virtual void update(unsigned int time);
    virtual InterfaceElement* collisionCheck(int x, int y);
    virtual void draw(sf::RenderTarget& target, sf::RenderStates states) const;
    virtual ~Panel();
};

#endif